﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Concat
{
    class Word
    {
        public Location loc;
        public string[] formals;
        public Term[] terms;
        public HashSet<string> ignoredDynamicWords;

        public Word(Location loc, string[] formals, Term[] terms, HashSet<string> ignoredDynamicWords)
        {
            this.loc = loc;
            this.formals = formals;
            this.terms = terms;
            this.ignoredDynamicWords = ignoredDynamicWords;
        }
        protected Word(string[] formals)
        {
            loc = null;
            this.formals = formals;
            terms = null;
            this.ignoredDynamicWords = new HashSet<string>();
        }
    }

    delegate object[] BuiltinFunc(object[] args);
    class BuiltinWord : Word
    {
        public BuiltinFunc func;

        public BuiltinWord(string[] formals, BuiltinFunc func)
            : base(formals)
        {
            this.func = func;
        }
    }
}
